package com.jp.knowledge.my.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author gzejia 978862664@qq.com
 */
public class OptionSelectModel implements Parcelable {

    // >>>>> Local
    // 图片资源（本地）
    public int mImage;

    // 选项内容
    public String mContent;

    // 选项值
    public String mValue;

    // 选中状态 true_选中, false_未选中
    public boolean isSelect;
    // <<<<< End

    public boolean  showTip;

    public int tipCount;

    public int getmImage() {
        return mImage;
    }

    public void setmImage(int mImage) {
        this.mImage = mImage;
    }

    public String getmContent() {
        return mContent;
    }

    public void setmContent(String mContent) {
        this.mContent = mContent;
    }

    public String getmValue() {
        return mValue;
    }

    public void setmValue(String mValue) {
        this.mValue = mValue;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public boolean isShowTip() {
        return showTip;
    }

    public void setShowTip(boolean showTip) {
        this.showTip = showTip;
    }

    public int getTipCount() {
        return tipCount;
    }

    public void setTipCount(int tipCount) {
        this.tipCount = tipCount;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.mImage);
        dest.writeString(this.mContent);
        dest.writeString(this.mValue);
        dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
        dest.writeByte(this.showTip ? (byte) 1 : (byte) 0);
        dest.writeInt(this.tipCount);
    }

    public OptionSelectModel() {
    }

    protected OptionSelectModel(Parcel in) {
        this.mImage = in.readInt();
        this.mContent = in.readString();
        this.mValue = in.readString();
        this.isSelect = in.readByte() != 0;
        this.showTip = in.readByte() != 0;
        this.tipCount = in.readInt();
    }

    public static final Creator<OptionSelectModel> CREATOR = new Creator<OptionSelectModel>() {
        @Override
        public OptionSelectModel createFromParcel(Parcel source) {
            return new OptionSelectModel(source);
        }

        @Override
        public OptionSelectModel[] newArray(int size) {
            return new OptionSelectModel[size];
        }
    };
}
